const { join } = require('path')

module.exports = {
  preset: '@swc-node/jest',
  testEnvironment: 'jsdom',
  rootDir: join(__dirname, '..'),
  moduleNameMapper: {
    '@slardar/sdk$': join('<rootDir>', 'packages', 'browser', 'src', 'npm.ts'),
    '@slardar/sdk-core$': join('<rootDir>', 'packages', 'core', 'src', 'index.ts'),
    '@slardar/polyfill': join('<rootDir>', 'packages', 'polyfill'),
    '@slardar/([^/]+)(.*)$': '<rootDir>/packages/$1/src$2',
  },
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'd.ts'],
  testMatch: ['<rootDir>/packages/{browser,core,tracing,hybrid}/**/__test__/**/*.test.ts'],
  testPathIgnorePatterns: [
    '<rootDir>/packages/trace',
    '<rootDir>/packages/core/src/monitors-new',
    '<rootDir>/packages/sdk-web',
  ],
  coverageReporters: ['json', 'text'],
  coveragePathIgnorePatterns: ['__test__', '__tests__'],
}
